<?xml version="1.0" encoding="windows-1250"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
 <xsl:output method="xml" encoding="windows-1250" />    

 <xsl:param name="concepts"/>
 <xsl:param name="conceptsdoc" select="document(translate($concepts, '\', '/'))"/>
 
 <xsl:template match="/">
   <DepConcepts>
     <xsl:apply-templates select="/node()/node()/Concepts/Concept"/>
   </DepConcepts>
 </xsl:template>

 <xsl:template match="Concept">
   <xsl:param name="used"></xsl:param> <!-- this is because we do not want this to end in endless loop ... -->
   <xsl:variable name="usednew"><xsl:value-of select="$used"/>#<xsl:value-of select="@name"/></xsl:variable>
   <Dep concept="{@name}" oid="{@id_concept}" used="{$used}"/>     
   <xsl:for-each select="$conceptsdoc/Concepts/Concept[current()/@name=substring-before(CProperties/CProperty/@ref,'/')]">
     <xsl:if test="not(contains($used,@name))">
       <xsl:apply-templates select=".">
         <xsl:with-param name="used"><xsl:value-of select="$usednew"/></xsl:with-param>
       </xsl:apply-templates>
     </xsl:if>
   </xsl:for-each>                 
 </xsl:template>
 


</xsl:stylesheet>
       
 
